From dfcd4f6e10aec1aadd882c12ec21220d91da4d7a Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Tue, 8 Aug 2006 09:57:24 +0100 Subject: [PATCH] [LIBXC] Do not gzclose() after close() on a gzdopen()'ed fd. Signed-off-by: Steven Rostedt --- tools/libxc/xc_linux_build.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/libxc/xc_linux_build.c b/tools/libxc/xc_linux_build.c index 4a611fdd44..9e7d39e34a 100644 --- a/tools/libxc/xc_linux_build.c +++ b/tools/libxc/xc_linux_build.c @@ -1373,10 +1373,10 @@ int xc_linux_build(int xc_handle, error_out: free(image); - if ( fd >= 0 ) - close(fd); - if ( initrd_info.u.file_handle ) + if ( initrd_info.type == INITRD_file && initrd_info.u.file_handle ) gzclose(initrd_info.u.file_handle); + else if ( fd >= 0 ) + close(fd); return sts; } -- 2.30.2